from django.conf.urls import url
from . import views

urlpatterns = [
    # 注册页面
    url(r'^register/$', views.RegisterView.as_view(),name='register'),
    # 用户名重复校验
    url(r'^usernames/(?P<username>[a-zA-Z0-9_-]{5,20})/count/$', views.UsernameCountView.as_view()),
    # 手机号重复校验
    url(r'^mobiles/(?P<mobile>1[3-9]\d{9})/count/$', views.MobileCountView.as_view()),
    # 登录界面
    url(r'^login/$',views.LoginView.as_view(),name='login'),
    # 退出登录
    url(r'^logout/$',views.LogoutView.as_view(),name='logout'),
    # 用户中心
    url(r'^info/$',views.UserInfoView.as_view(),name='info'),
    # 设置邮箱
    url(r'^emails/$', views.EmailView.as_view(), name='email'),
    # 验证邮箱
    url(r'^emails/verification/$', views.CheckEmailView.as_view(), name='check_email'),
    # 收获地址
    url(r'^addresses/$', views.AddressesView.as_view(), name='addresses'),
    # 新增收获地址
    url(r'^addresses/create/$', views.CreateAddressesView.as_view()),
    # 修改和删除收获地址
    url(r'^addresses/(?P<address_id>\d+)/$', views.ChangeDeleteAddressView.as_view()),
    # 设置默认收获地址
    url(r'^addresses/(?P<address_id>\d+)/default/$', views.DefaultAddressView.as_view()),
    # 修改收获地址标题
    url(r'^addresses/(?P<address_id>\d+)/title/$', views.AddressTitleView.as_view()),
    # 修改密码
    url(r'^password/$', views.ChangePasswordView.as_view(), name='password'),
    # 历史浏览记录
    url(r'^browse_histories/$', views.HistoryGoodsView.as_view(), name='browse_histories'),
    # 我的订单
    url(r'^orders/info/1/$', views.MyOrderView.as_view(), name='my_order'),
    ]